import request from "@/api/request";
import { type AxiosRequestConfig } from "axios";
import { type DeepRequired } from "../../interface";

/**
 * /contractFile/add
 */
export function postContractFileAdd(params: PostContractFileAddParams, input?: PostContractFileAddInput, config?: AxiosRequestConfig) {
    const paramsInput = {
        contractId: params.contractId,
        title: params.title,
        remark: params.remark,
        type: params.type,
    };
    return request.post<DeepRequired<any>>(`/contractFile/add`, input, {
        params: paramsInput,
        ...config,
    });
}

export interface PostContractFileAddParams {
    contractId?: number;
    title?: string;
    remark?: string;
    type?: string;
}

export interface PostContractFileAddInput {
    file: File;
}
